{% extends "public/layout.html" %}

{% block css %}

    <link rel="stylesheet" type="text/css" href="/static/vendor/bs-is-fun.css">
    <style>
    .nav > li.active{background:none;border:none;}
    .step > li > a {padding: 11px 10px 5px 25px;}
    </style>

{% endblock %}



{% block breadcrumb %}
     <ol class="breadcrumb">
        <li>
            <a href="{% url 'index' %}">首页</a>
        </li>
         <li>
             <a>发布系统</a>
         </li>
        <li class="active">
            <strong>上线进度</strong>
        </li>
    </ol>
{% endblock %}


{% block body %}
<div  class="wrapper wrapper-content animated fadeInRight">
<div class="row">
  <div class="col-sm-12">
            <div class="ibox float-e-margins">
                <div class="ibox-title">
                    <ul class="nav nav-pills nav-justified step step-arrow">
                        <li class="active">
                            <a>申请中</a>
                        </li>
                        <li class="{% if apply_release.status >= 1 %}active{% endif %}">
                            <a>仿真</a>
                        </li>
                        <li class="{% if apply_release.status >= 2%}active{% endif %}">
                            <a>上线完成</a>
                        </li>
                    </ul>
                </div>
                <br>
                <br>
                <br>
                <div class="ibox-content">
                    <form method="post" action="{% url 'code_release_status' %}" class="form-horizontal">
                            {% if msg %}
                                <div class="alert alert-success alert-dismissable">
                                    <button aria-hidden="true" data-dismiss="alert" class="close" type="button">×</button>
                                    {{ msg | safe }}
                                </div>
                            {% endif %}
                            <input type="hidden" name="id" value="{{ apply_release.id }}">
                            <div class="form-group"><label class="col-sm-2 control-label">项目名称：</label>
                                <div class="col-sm-8">
                                    <input type="text" class="form-control" readonly="readonly" name="name" value="{{ apply_release.name }}" placeholder="项目名称">
                                </div>
                            </div>

                            <div class="hr-line-dashed"></div>
                            <div class="form-group"><label class="col-sm-2 control-label">发布版本：</label>
                                <div class="col-sm-8">
                                    <input type="text" class="form-control" readonly="readonly" name ="project_version" value="{{ apply_release.project_version }}" placeholder="发布版本" />  

                              </div>
                            </div>

                            <div class="hr-line-dashed"></div>
                            <div class="form-group"><label class="col-sm-2 control-label">版本描述：</label>
                                <div class="col-sm-8">
                                    <input type="text" class="form-control" readonly="readonly" name ="version_desc" value="{{ apply_release.version_desc }}" placeholder="版本描述" />
                                </div>
                            </div>
                            <div class="hr-line-dashed"></div>
                            <div class="form-group"><label class="col-sm-2 control-label">上线人：</label>
                                <div class="col-sm-8">
                                    <input type="text" class="form-control" readonly="readonly" name ="assigned_to" value="{{ apply_release.assigned_to.name }}" placeholder="版本描述" />
                                </div>
                            </div>
                            <div class="hr-line-dashed"></div>
                             <div class="form-group"><label class="col-sm-2 control-label">更新详情：</label>
                                <div class="col-sm-8">
                                    <textarea class="form-control" readonly="readonly" name ="update_detail" rows="3" placeholder="更新详情">{{ apply_release.update_detail }}</textarea>
                                </div>
                            </div>
                            <input type="hidden" name="status" value="{{ apply_release.status }}">

                            <div class="hr-line-dashed"></div>
                                <div class="form-group">
                                    <div class="col-sm-4 col-sm-offset-2">
                                    {% if request.user.id == apply_release.assigned_to_id %}
                                        {% if apply_release.status == 0 %}
                                            <button id="submit_button" class="btn btn-primary" type="submit">仿真</button>
                                        {% elif apply_release.status == 1 %}
                                            <button id="submit_button" class="btn btn-primary" type="submit">上线</button>
                                        {% elif apply_release.status == 2 %}
                                                <button id="submit_button" class="btn btn-primary" type="submit">完成</button>
                                        {% endif %}
                                        <button class="btn btn-white" type="button">取消</button>
                                    {% elif request.user.id == apply_release.applicant_id %}
                                        <button class="btn btn-primary" type="button">催一下</button>
                                    {% else %}

                                    {% endif %}
                                    </div>
                                </div>

                        </form>
                </div>
                <div class="ibox-footer">
                    {% if request.user.id == apply_release.applicant_id %}
                        <p>催一下：<b>用于催促上线人尽快上线，按钮点下去之后会给上线人发一封邮件...</b></p>
                    {% endif %}
                </div>
            </div>
        </div>
    </div>
</div>

{% endblock %}

